package com.cjm.spi.origin;

import java.util.ServiceLoader;

public class SpiDemo {
    public static void main(String[] args) {
        ServiceLoader<DataStorage> serviceLoader = ServiceLoader.load(DataStorage.class);
        System.err.println("============ java spi 测试 =============");
        serviceLoader.forEach(loader -> System.err.println(loader.search("Yes or No")));
    }
}
